'use strict';

const Controller = require('egg').Controller;

class HeroController extends Controller {
    // 查询
    async index() {
        let heroList = await this.ctx.service.hero.getHeroList()
        this.ctx.body = heroList
    }
    // 添加
    async create() {
        let heroList = await this.ctx.service.hero.create()
        this.ctx.body = heroList
        
    }
    // 删除
    async destroy() {
        let heroList = await this.ctx.service.hero.destroy()
        this.ctx.body = heroList
        
    }
    // 修改
    async update() {
        let heroList = await this.ctx.service.hero.update()
        this.ctx.body = heroList

    }
}

module.exports = HeroController;
